<?php
header("Content-type:text/html;charset=utf-8"); 
define('M_ROOT', str_replace("\\", '/', dirname(__FILE__)).'/');
require str_replace("\\", '/', dirname(dirname(__FILE__))).'/'.'inc/common.inc.php';
include './include/global.func.php';
require 'cache.func.php';

//对数组进行编码转换
array2utf8($CAT);
array2utf8($AREA);
array2utf8($DC);
array2utf8($hotkeys);



function mtpl($template = 'index')
{
       $template_m = 'm_'.$template;
	$tplfile = M_ROOT."templates/$template.html";
	$compiledtplfile = TPL_CACHEPATH_ADMIN.$template_m.'.tpl.php';

       if(!file_exists($tplfile)) err("M模板文件 $template  不存在！");
	if(TPL_REFRESH && (!file_exists($compiledtplfile) || @filemtime($tplfile) > @filemtime($compiledtplfile)))
	{
		require_once 'template.func.php';
		template_compile_m($template);
	}
	return $compiledtplfile;
}
?>